<?= $form ?>
<div class="yx-clear">
    <div style="padding-left: 20%">
        <?=\yii\helpers\Html::buttonInput('生成卡号',['class'=>'btn yx-radius2 yx-d-card yx-bg94d5a2','style'=>'margin:0','id'=>'createCard','data'=>['url'=>\common\components\helpers\Fun::url(['oldclassmanage/addoldstudent','id'=>\Yii::$app->request->get('id')])]])?>
    </div>
</div>

<?= $this->renderFile('@app/views/layouts/script_data.php'); ?>
<?php
$js = <<<JS
$(document).on('click','#createCard',function(){
    var url = $(this).data('url');
    $.post(url,{ajax:'createCard'},function(data){
       $('#classmanage-card_id').val(data);
    },"json");
});
JS;
$this->registerJS($js);
?>
